﻿
using Entity;
using Entity.ViewModel.UserInfo;

namespace IBll
{
    /// <summary>
    /// 用户业务逻辑接口
    /// </summary>
    public interface IUserInfoBll
    {
        /// <summary>
        /// 创建用户
        /// </summary>
        /// <param name="account"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public bool CreateUserInfo(string account, string password, out string msg);


        /// <summary>
        /// 添加用户
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="phone"></param>
        /// <param name="sex"></param>
        /// <param name="email"></param>
        /// <param name="departmentId"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        public bool CreateUserInfo(string userName, string account, string phone, int sex, string email, string departmentId, out string msg);


        /// <summary>
        /// 软删除用户
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool DeleteUserInfo(string id);

        /// <summary>
        /// 批量软删除用户
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public bool DeleteUserInfos(List<string> ids);

        ///// <summary>
        ///// 下载头像
        ///// </summary>
        ///// <param name="userId"></param>
        ///// <returns></returns>
        //byte[] DownloadImg(string userId,out string fileName);




        /// <summary>
        /// 获取下拉选备选数据
        /// </summary>
        /// <returns></returns>
        object GetSelectOptionList();


        /// <summary>
        /// 根据用户id获取用户信息
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public UserInfoViewModel GetUserInfoById(string userId);



        /// <summary>
        /// 获取用户集合
        /// </summary>
        public List<GetUserInfoListViewModel> GetUserInfoList(string userName, string phone, int page, int limit, out int count);

        /// <summary>
        /// 验证登录
        /// </summary>
        /// <param name="account"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public bool Login(string account, string password, out UserInfo userInfo, out string msg);


        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="oldPassword"></param>
        /// <param name="newPassword"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        public bool UpdatePassword(string userId, string oldPassword, string newPassword, out string msg);

        /// <summary>
        /// 更新用户
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="userName"></param>
        /// <param name="phoneNum"></param>
        /// <param name="email"></param>
        /// <param name="sex"></param>
        /// <returns></returns>
        public bool UpdateUserInfo(string userId, string userName, string phoneNum, string email, int sex, string departmentId);

        //bool UploadImg(Stream stream, string fileName, string userId, out string msg);
    }
}